import Vue from 'vue'
import VueI18n from 'vue-i18n'
import Cookie from 'js-cookie'
import ElementEN from 'element-ui/lib/locale/lang/en'
import ElementZH from 'element-ui/lib/locale/lang/zh-CN'
import customZH from './zh'
import customEN from './en'

Vue.use(VueI18n)
export default new VueI18n({
  locale: Cookie.get('language') || 'en', // 从cookie中获取语言类型 获取不到就是中文
  messages: {
    en: {
      ...ElementEN, ...customEN// 将饿了么的英文语言包引入
    },
    zh: {
      ...ElementZH, ...customZH
    }
  }
})
